package com.hexu.event.controller;

import jakarta.servlet.*;
import jakarta.servlet.http.*;

import java.io.IOException;

import static com.hexu.event.util.ServiceUtil.loginService;


public class LoginServlet extends HttpServlet {

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //登录验证 账号或密码错误就提示
        if(!loginService.login(request, response)){
            request.setAttribute("error","账号或密码错误");
            request.setAttribute("address","Login.html");
            request.getRequestDispatcher("/error.jsp").forward(request, response);
        }

    }
}
